﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Grooveshark
{
    internal class Artist : GroovesharkGroupObject, IEquatable<Artist>
    {
        public Artist(int id, string name)
        {
            this.ID = id;
            this.Name = name;
        }

        public bool Equals(Artist other)
        {
            return this.ID.Equals(other.ID);
        }

        public override int GetHashCode()
        {
            return ID.GetHashCode();
        }
    }

    internal class Album : GroovesharkGroupObject, IEquatable<Album>
    {
        public Album(int id, string name, int artistId)
        {
            this.Name = name;
            this.ID = id;
            this.ArtistID = artistId;
        }

        public int ArtistID
        {
            get;
            private set;
        }

        public bool Equals(Album other)
        {
            return this.ID.Equals(other.ID);
        }

        public override int GetHashCode()
        {
            return ID.GetHashCode();
        }
    }

    internal class Playlist : GroovesharkGroupObject, IEquatable<Playlist>
    {
        public Playlist(int id, string name)
        {
            this.Name = name;
            this.ID = id;
        }

        public bool Equals(Playlist other)
        {
            return this.ID.Equals(other.ID);
        }

        public override int GetHashCode()
        {
            return ID.GetHashCode();
        }
    }

    internal abstract class GroovesharkGroupObject
    {
        public string Name
        {
            get;
            protected set;
        }

        public int ID
        {
            get;
            protected set;
        }
    }

    internal class BackObject
    {
        public BackObject(GroovesharkGroupObject goBackTo)
        {
            this.GoBackTo = goBackTo;
        }

        public GroovesharkGroupObject GoBackTo
        {
            get;
            private set;
        }
    }

}
